「檔案即真理」的哲學
OpenClaw 的根基是 Markdown 首選哲學。與傳統的黑箱式人工智慧系統不同,OpenClaw 將設定視為文件。代理的每一項存在面向——其個性、能力與操作流程——皆儲存在人類可讀的 Markdown 檔案中。這確保了「唯一真相來源」具有透明性、版本控制能力,且對人類與大語言模型而言都易於編輯。
- SOUL.md: 核心身份與道德指南。
- SKILL.md: 定義代理實際能執行功能的清單。
- AGENTS.md: 多代理協調的工程藍圖。
核心基礎設施堆疊
為從靜態檔案轉化為活躍的代理,OpenClaw 採用穩健的後端架構,以確保穩定性與彈性:
- 代理執行時間:負責管理 Lane Queue。它確保非同步任務能順利處理,而不會造成 狀態腐敗,並維持 會話隔離 在每一個互動中。
- 網關:負責處理網路身分與模型路由的控制平面。它如同一道安全屏障,降低如 遠端程式碼執行(RCE) 透過 WebSocket API 的風險。
- 工具層: 一個模組化的介面,讓代理能連接外部函數、API 與技能清單中定義的本機腳本。
- 模型無關引擎:系統不被鎖定於單一供應商。它能透過 openclaw.json 路由器,在 Claude、GPT 或本地模型間自由切換。
- 介面與通路: 這些是代理與使用者互動的點(網頁介面、終端機或行動裝置)。
設定:openclaw.json
{
"network_identity": "agent-01-alpha",
"model_routing": {
"primary": "anthropic/claude-3-opus",
"fallback": "local/llama-3-8b"
},
"env_injection": {
"secure_pass": true,
"policy": "prevent_leakage"
}
}
Type a command...
Question 1
Why does OpenClaw prioritize a Markdown-First Philosophy?
Question 2
Which component is responsible for preventing State Corruption during multi-agent tasks?
Challenge: Security Breach
Mitigating RCE risks on public channels.
Scenario: You are deploying an agent to a public-facing Discord channel. You notice that the agent is trying to execute unverified shell commands, creating an RCE (Remote Code Execution) risk.
Secure
How do you use the Gateway and SKILL.md to secure the infrastructure?
Solution:
1. Gateway Level: Restrict the WebSocket API port (18789) to local traffic only or implement strict authentication tokens.
2. SKILL.md Level: Define strict "Permissions" in the YAML metadata for the Tools Layer.
3. Instruction Level: Update the Six-Layer Filtering Funnel within the skill manifest to reject any command string that contains sensitive shell operators.
1. Gateway Level: Restrict the WebSocket API port (18789) to local traffic only or implement strict authentication tokens.
2. SKILL.md Level: Define strict "Permissions" in the YAML metadata for the Tools Layer.
3. Instruction Level: Update the Six-Layer Filtering Funnel within the skill manifest to reject any command string that contains sensitive shell operators.